package dflow.application.service;

import dflow.domain.CallResult;
import dflow.domain.User;
import dflow.repository.UserRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * Created by dustin on 2017/7/18.
 */
@Service
public class AuthorService {
    @Autowired
    UserRepository userRepository;
    public CallResult Login(String name, String pwd){
        User user= userRepository.findByNicknameAndPassword(name,pwd);
        if(null==user) return CallResult.error("用户名或密码错误！");
        return CallResult.ok(user);
    }
}
